package com.spm.librarianmanagersystem.pojo;

import java.util.Date;
import java.util.Objects;

public class Message {
    private Integer messageId;

    private String title;

    private String content;

    private Date time;

    private Integer type;

    private Integer id;

    private Integer user_id;

    public Message(Integer messageId, String title, String content, Date time, Integer type, Integer id, Integer user_id) {
        this.messageId = messageId;
        this.title = title;
        this.content = content;
        this.time = time;
        this.type = type;
        this.id = id;
        this.user_id = user_id;
    }

    public Integer getMessageId() {
        return messageId;
    }

    public void setMessageId(Integer messageId) {
        this.messageId = messageId;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public Date getTime() {
        return time;
    }

    public void setTime(Date time) {
        this.time = time;
    }

    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getUser_id() {
        return user_id;
    }

    public void setUser_id(Integer user_id) {
        this.user_id = user_id;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Message message = (Message) o;
        return Objects.equals(messageId, message.messageId) && Objects.equals(title, message.title) && Objects.equals(content, message.content) && Objects.equals(time, message.time) && Objects.equals(type, message.type) && Objects.equals(id, message.id) && Objects.equals(user_id, message.user_id);
    }

    @Override
    public int hashCode() {
        return Objects.hash(messageId, title, content, time, type, id, user_id);
    }

    @Override
    public String toString() {
        return "Message{" +
                "messageId=" + messageId +
                ", title='" + title + '\'' +
                ", content='" + content + '\'' +
                ", time=" + time +
                ", type=" + type +
                ", id=" + id +
                ", user_id=" + user_id +
                '}';
    }
}
